
import router from './router'
import Vue from 'vue';
//引入elementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue';
//引入typed.js
import VueTypedJs from 'vue-typed-js'
import APlayer from '@moefe/vue-aplayer';
import axios from 'axios'
//引入markdown编辑器
import VMdEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
//引入markdown预览器
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';
// 引入github主题
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
// prismjs高亮代码行
import Prism from 'prismjs';
axios.defaults.baseURL='/api'
//引入qs模块(用来解决请求传值为null的煞笔问题)
import qs from 'qs'
Vue.prototype.$qs = qs
//引入nprogress(加载进度条)插件和样式，
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
//引入评论Emoji
import VEmojiPicker from 'v-emoji-picker';
//引入标签云
import tagCloud from 'v-tag-cloud'
VMdPreview.use(vuepressTheme, {
  Prism,
  config: {
    toc: {
      includeLevel: [2, 3],
    },
  },
});
VMdEditor.use(vuepressTheme, {
  Prism,
  config: {
    toc: {
      includeLevel: [2, 3],
    },
  },
});

NProgress.configure({ showSpinner: false })

router.beforeEach((to,from,next)=> {
  NProgress.start()
  next()
})

router.afterEach(()=>{
  NProgress.done()
})

Vue.use(tagCloud,{
  config: {
    maxFont: '12'
  }
})
Vue.use(VEmojiPicker);
Vue.use(VMdEditor)
Vue.use(VMdPreview);
Vue.use(APlayer,{
  defaultCover: 'https://github.com/u3u.png',
  productionTip: true,
})
Vue.use(VueTypedJs);
Vue.use(ElementUI);

Vue.prototype.$axios=axios
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: h => h(App),
  components: { App },
  template: '<App/>'
})

